package com.xinchao.service;

import com.xinchao.core.exception.ServiceException;
import com.xinchao.model.DeviceModel;
import com.xinchao.model.dto.DeviceModelDTO;
import com.xinchao.model.page.PageInfo;
import com.xinchao.model.vo.DeviceModelExportListVO;
import com.xinchao.model.vo.DeviceModelListVO;
import com.xinchao.model.vo.DeviceModelSelectListVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 终端机型
 *
 * @author linqiang
 * @date 2018-08-07 14:47
 */
public interface DeviceModelService {
    /**
     * 获取终端型号分页列表
     * @param pageNum 当前页
     * @param pageSize 每页条数
     * @param deviceModel
     * @param mainboard
     * @param brand
     * @param isExist4G 是否存在4G功能
     * @return Page<DeviceModelListVO>
     */
    PageInfo<DeviceModelListVO> listDeviceModelByPage(Integer pageNum, Integer pageSize, String deviceModel, String mainboard, String brand, Boolean isExist4G);

    /**
     * 通过型号名称查找终端机型信息
     *
     * @param deviceModel 型号名称
     * @return DeviceModel
     */
    DeviceModel getDeviceModelByName(String deviceModel);

    /**
     * 新增终端机型
     *
     * @param deviceModel 新增的机型
     * @param request     请求
     */
    void addDeviceModel(DeviceModel deviceModel, HttpServletRequest request);

    /**
     * 批量删除终端型号
     *
     * @param deviceModelIds 终端型号Id(多个Id之间用逗号隔开 )
     * @param request        请求
     * @throws ServiceException
     */
    void deleteDeviceModelBatch(String deviceModelIds, HttpServletRequest request) throws ServiceException;

    /**
     * 修改机型
     *
     * @param deviceModel 机型
     * @param request     请求
     * @throws ServiceException
     */
    void updateByPrimaryKeySelective(DeviceModel deviceModel, HttpServletRequest request) throws ServiceException;

    /**
     * 根据主键获取机型
     *
     * @param deviceModelId 主键
     * @return DeviceModel
     */
    DeviceModel getDeviceModelById(Long deviceModelId);

    /**
     * 查询机型下拉集合
     *
     * @return List<DeviceModelSelectListVO>
     */
    List<DeviceModelSelectListVO> selectList();

    /**
     * 查询升级包中的适用机型
     *
     * @param deviceUpgradeId 升级ID
     * @return List<DeviceModelDTO>
     */
    List<DeviceModelDTO> listDeviceModelsSelectedUpgrade(Long deviceUpgradeId);

    /**
     * 获取终端型号列表
     * hanqr 2018-08-14
     *
     * @return
     */
    List<DeviceModelDTO> listDeviceModels();

    /**
     * 终端机型导出列表
     *
     * @return List
     */
    List<DeviceModelExportListVO> listExport(String deviceModel,String mainboard,String brand,Boolean isExist4G);
}
